<?php

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_Backend
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: header.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */

if(Zend_Auth::getInstance()->hasIdentity()){
	$model = Zend_Auth::getInstance()->getIdentity();
	$name  = $model->getUsername();
}

$locale = Evebit_Application::getSession()->getLocale();
$emailHelper = new Evebit_Email_Helper();
$fullBasePath = $emailHelper->getFullBasePath();
$length = strpos($fullBasePath, 'admins') === false?strlen($fullBasePath):strpos($fullBasePath, 'admins');
$frontendUrl = substr($fullBasePath, 0, $length);
?>

<!-- Header -->

<div id="header"> 
  
  <!-- Top -->
  <div id="top"> 
    <!-- Logo -->
    <div class="logo"> <a href="#" title="Administration Home" class="tooltip"><img src="<?php echo $this->baseUrl('/media/assets/logo.png')?>" alt="Wide Admin" /></a> </div>
    <!-- End of Logo --> 
    
    <!-- Meta information -->
    <div class="meta">
      <p>Welcome, <?php echo $name?><!-- a href="#" title="1 new private message from Elaine!" class="tooltip">1 new message!</a--></p>
      <!-- select id="lang-selector" class="lang-selector">
				<option <?php if($locale=='en_US'):?>selected<?php endif;?> value="en_US"><?php echo $this->__('English')?></option>
				<option <?php if($locale=='de_DE'):?>selected<?php endif;?> value="de_DE"><?php echo $this->__('German')?></option>
				<option <?php if($locale=='da_DK'):?>selected<?php endif;?> value="da_DK"><?php echo $this->__('Danish')?></option>
			</select-->
      <ul>
        <li><a href="<?php echo $this->baseUrl().'/default/index/logout';?>" title="End administrator session" class="tooltip"><span class="ui-icon ui-icon-power"></span>Logout</a></li>
        <!-- li><a href="#" title="Change current settings" class="tooltip"><span class="ui-icon ui-icon-wrench"></span>Settings</a></li>-->
        <li><a target="_new" href="<?php echo $frontendUrl?>" title="Go to the frontend" class="tooltip"><span class="ui-icon ui-icon-circle-zoomout"></span>View site</a></li>
      </ul>
    </div>
    <!-- End of Meta information --> 
  </div>
  <!-- End of Top--> 
  
  <!-- The navigation bar -->
  <div id="navbar"> <?php echo $this->placeholder("topnav") ?> </div>
  <!-- End of navigation bar" --> 
  
  <!-- Search bar --> 
  <!-- div id="search">
					<form method="post" action="/search/">
						<p>
							<input type="submit" value="" class="but" />
							<input type="text" class="searchbox" name="q" value="Search the admin panel" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
				
						</p>
					</form>
				</div--> 
  <!-- End of Search bar --> 
  
</div>
<!-- End of Header --> 
